package com.jsong.linuo.polymorphic;

/**
 * @Author: 黎诺
 * @CreateTime: 2025-04-24
 * @Description: 笔记本电脑类
 */

public class NoteBook {
    public void start() {
        System.out.println("开机");
    }

    public void useUSB(USB usb) {
        if (usb instanceof Mouse) {
            Mouse mouse = (Mouse) usb;
            mouse.open();
            mouse.click();
            mouse.close();
        } else {
            KeyBorad keyBorad = (KeyBorad) usb;
            keyBorad.open();
            keyBorad.qiaoji();
            keyBorad.close();
        }
    }

    public void stop() {
        System.out.println("关机");
    }
}
